﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using DBUtility;
using IDAL.RF.Package;
using Model.RF.Package;

namespace DAL.RF.Package
{
    public class PackintoBoxItem_WithoutUpload : BaseRepository_DT<PackintoBoxItem_WithoutUploadInfo>, IPackintoBoxItem_WithoutUpload
    {
        #region 静态变量部分
        private const string PARM_PACKINTOBOXITEM_PACKAGEPRODUCTSN = "@PackageProductSN";
        #endregion


        #region 数据检索部分

        public IList<PackintoBoxItem_WithoutUploadInfo> GetPackintoBoxItem_WithoutUpload_bySN(string packageProductSN)
        {
            SqlParameter parm = GetParameter();
            parm.Value = packageProductSN;
            return ExcuteSqlToGetEntities("PackintoBoxItem_WithoutUpload_GetbySN", parm);
        }

        public IList<PackintoBoxItem_WithoutUploadInfo> GetPackintoBoxItem_WithoutUpload_byDT(DateTime dt1, DateTime dt2)
        {
            SqlParameter[] parms = GetDTParameters();
            parms[0].Value = dt1;
            parms[1].Value = dt2;
            return ExcuteSqlToGetEntities("PackintoBoxItem_WithoutUpload_GetbyDT", parms);
        }
        #endregion


        #region 重写基类部分
        //-------------------------------------重写超类基础操作---------------------------------------------------------

        public override PackintoBoxItem_WithoutUploadInfo GetEntityRecord(SqlDataReader rdr)
        {
            PackintoBoxItem_WithoutUploadInfo pro = new PackintoBoxItem_WithoutUploadInfo()
            {
                PackageProductSN = rdr.GetValue(0).ToString(),
                RecordTime = rdr.GetDateTime(1),
                ProductTypeID = rdr.GetValue(2).ToString(),
                UserID = rdr.GetValue(3).ToString(),
                PCIP = rdr.GetValue(4).ToString(),
                Remark = rdr.GetValue(5).ToString()
            };
            return pro;
        }

        public override PackintoBoxItem_WithoutUploadInfo GetEntityRecord()
        {
            PackintoBoxItem_WithoutUploadInfo pro = null;
            return pro;
        }

        public override SqlParameter GetParameter()
        {
            SqlParameter Parm = new SqlParameter(PARM_PACKINTOBOXITEM_PACKAGEPRODUCTSN, SqlDbType.NVarChar, 50);
            return Parm;
        }
        #endregion
    }
}
